const puppeteer = require("puppeteer");
// 代理服务器(产品官网 www.16yun.cn)
const proxyServer = "http://u10145.5.tn.16yun.cn:6441";

const username = "16VQKKXT";
const password = "901565";

(async () => {
  try {
    const browser = await puppeteer.launch({
      args: [
        "--proxy-server=" + proxyServer + "",
        "--no-sandbox",
        "--disable-setuid-sandbox",
      ],
    });
    const page = await browser.newPage();
    await page.authenticate({ username, password });
    await page.goto("https://www.wjx.cn/vm/w70ZjFc.aspx");
    const cookies = await page.cookies();
    await console.log(cookies);
    // await page.setViewport({ width: 320, height: 480 });
    // await page.screenshot({ path: "/screenshots/full.png", fullPage: true });
    await browser.close();
  } catch (e) {
    console.log("错误", e);
  }
})();
